<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="档案编号" :labelCol="labelCol">
              <a-input placeholder="请输入档案编号" v-model="queryParam.billNo"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="项目名称" :labelCol="labelCol">
              <j-input placeholder="请输入项目名称" v-model="queryParam.projectName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="项目编号" :labelCol="labelCol">
              <a-input placeholder="请输入项目编号" v-model="queryParam.finalNo"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="经营团队" :labelCol="labelCol">
              <select-team-input v-model="queryParam.teamName" :tdlx="1" :teamType="0"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="项目承接人">
              <j-input placeholder="请输入项目承接人" v-model="queryParam.undertakerName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="业主单位">
              <j-input placeholder="请输入业主单位" v-model="queryParam.enterpriseName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="收款合同名称">
              <j-input placeholder="请输入收款合同名称" v-model="queryParam.contractName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-model-item label="业务分类" :labelCol="labelCol">
              <business-category-name-select v-model="queryParam.categoryCode" @back="businessCategoryHandle"/>
            </a-form-model-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="合同分配额(元)" :labelCol="labelCol">
              <a-input-number
                :precision="2"
                placeholder="请输入最小值"
                class="query-group-cust"
                v-model="queryParam.contractAmount_begin"
                @change="(val) => this.contractAmountRange = Number(val)"
                style="width: 47%"
                :min="0"
                :max="999999999"/>
              -
              <a-input-number
                :precision="2"
                placeholder="请输入最大值"
                class="query-group-cust"
                v-model="queryParam.contractAmount_end"
                style="width: 47%"
                :min="contractAmountRange"
                :max="999999999"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-model-item label="生产团队" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productTeam">
              <select-team-input
                placeholder="请选择生产团队"
                v-model="queryParam.productTeam"
                :tdlx="2"
                :teamType="0"
                :triggerChange="true"/>
            </a-form-model-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="实施部门" :labelCol="labelCol" prop="executeDepart">
              <j-select-depart placeholder="请选择实施部门" v-model="queryParam.executeDepart"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="部门负责人" :labelCol="labelCol" prop="deptLeadName">
              <j-input placeholder="请输入部门负责人" v-model="queryParam.deptLeadName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="项目负责人" :labelCol="labelCol" prop="projLeadName">
              <j-input placeholder="请输入项目负责人" v-model="queryParam.projLeadName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-model-item label="任务进度" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input-number
                :precision="2"
                placeholder="请输入最小值"
                class="query-group-cust"
                v-model="queryParam.taskProgressBegin"
                @change="(val) => this.contractRateRange = Number(val)"
                style="width: 47%"
                :min="0"
                :max="100"/>
              -
              <a-input-number
                :precision="2"
                placeholder="请输入最大值"
                class="query-group-cust"
                v-model="queryParam.taskProgressEnd"
                style="width: 47%"
                :min="contractRateRange"
                :max="100"/>
            </a-form-model-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="是否变更中" :labelCol="labelCol" prop="changeStatus">
              <j-dict-select-tag placeholder="请选择是否变更中" v-model="queryParam.changeStatus" dictCode="change_status"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="状态" :labelCol="labelCol" prop="distributionType">
              <j-dict-select-tag placeholder="请选择状态" v-model="queryParam.distributionType" dictCode="distribution_type"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="是否存档" :labelCol="labelCol" prop="distributionType">
              <j-dict-select-tag placeholder="请选择状态" v-model="queryParam.isInFile" dictCode="yes_no"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-model-item label="存档时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inFileTime">
              <a-range-picker
              :disabled="false"
              :allowClear="false"
              v-model="dateTime"
              style="width: 100%"
              @change="createTimeChange"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
              <a-form-model-item label="任务类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskType">
                <j-dict-select-tag
                  type="list"
                  v-model="queryParam.taskType"
                  dictCode="task_type"
                  placeholder="请选择任务类型"/>
              </a-form-model-item>
            </a-col>
          <!-- <template v-if="toggleSearchStatus"></template> -->
          <a-col style="float: left;overflow: hidden;" :xl="6" :lg="7" :md="8" :sm="24">
            <span class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button @click="handleReset" icon="reload" style="margin-left: 8px;">重置</a-button>
              <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a> -->
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button type="primary" icon="download" @click="handleExportXls('任务档案')" :disabled="isDisabledAuth('erpFinanceTeamManager:export')">导出</a-button>
      <a-popover title="自定义列" trigger="click" placement="leftBottom" style="margin-bottom: 10px">
        <template slot="content">
          <a-checkbox-group @change="onColSettingsChange" v-model="settingColumns" :defaultValue="settingColumns">
            <a-row>
              <template v-for="(item, index) in defColumns">
                <template v-if="item.key!='rowIndex'&& item.dataIndex!='action'">
                  <a-col :span="12" :key="index">
                    <a-checkbox :value="item.dataIndex">
                      <!-- {{ item.title }} -->
                      <ellipsis :length="14">{{ item.title }}</ellipsis>
                    </a-checkbox>
                  </a-col>
                </template>
              </template>
            </a-row>
          </a-checkbox-group>
        </template>
        <a style="float: right;">
          <a-icon type="setting" :style="iconStyle"/>
        </a>
      </a-popover>
    </div>

    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:scrollX}"
        :components="draggableComponent"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        :loading="loading"
        class="j-table-force-nowrap"
        :customRow="customRow"
        @change="handleTableChange">
        <span v-if="text === '' || text === null || text === undefined" slot-scope="text, record" slot="projectName">
          --
        </span>
        <a slot="projectName" v-else slot-scope="text, record" :title="text" @click="onDetail(record.projectId)">{{ text }}</a>
        <template slot="htmc" :title="text" slot-scope="text, record">
          <a v-if="text" @click="getContractDetail(record.contractId)">{{ text }}</a>
          <span v-else>--</span>

          <!-- <ellipsis :length="9">{{text}}</ellipsis> -->
          <!-- <j-ellipsis :value="text" :length="15"/> -->
        </template>

        <span slot="action" slot-scope="text, record">
          <!-- v-if="record.changeStatus == '0'" -->
          <template v-if="record.changeStatus !== 'changing'">
            <a-button type="link" @click="onTaskAllocation(record)" v-if="record.distributionType == 'waiting' && record.changeStatus == 'unchanged'">
              任务委托
            </a-button>
            <a-button type="link" @click="onTaskReAllocation(record)" v-if="['producting', 'finish'].includes(record.distributionType) && record.changeStatus !== 'changing'">
              任务再委托
            </a-button>
            <a-button type="link" @click="onTaskChange(record)" v-if="record.distributionType == 'producting'">
              变更任务委托
            </a-button>
          </template>
        </span>
      </a-table>
    </div>

    <a-modal
      :maskClosable="false"
      title="项目存档申请单详情"
      :width="1200"
      :bodyStyle="{
        padding: '0 24px'
      }"
      :visible="visibleDetail"
      @cancel="handleCancelDetail"
      cancelText="关闭">
      <erp-project-archive-form ref="realForm" :disabled="true" normal />
      <template slot="footer">
        <a-button @click.stop="handleCancelDetail">关闭</a-button>
      </template>
    </a-modal>

    <!-- <erp-omc-contract-manager-final-modal ref="modalForm" @ok="modalFormOk"></erp-omc-contract-manager-final-modal> -->
    <erp-project-contract-manager-final-form ref="contractForm" ></erp-project-contract-manager-final-form>
    <!-- 项目详情开始 -->
    <erp-project-report-modal ref="projectModalForm"></erp-project-report-modal>
    <!-- 项目详情结束 -->
  </a-card>
</template>

<script>

import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgBpmListMixin } from '@/mixins/JeecgBpmListMixin'
// import ErpOmcContractManagerFinalModal from './modules/ErpOmcContractManagerFinalModal'
import { DisabledAuthFilterMixin } from '@/mixins/DisabledAuthFilterMixin'
import SelectCustomerInput from '@/views/scy/components/SelectCustomerInput'
import SelectTeamInput from '@/views/scy/components/SelectTeamInput'
import SelectProjectInput from '@/views/scy/components/SelectProjectInput'
import SelectUserByDep from '@/views/scy/components/SelectUserByDep'
import BusinessCategoryNameSelect from '@views/erp/components/BusinessCategoryNameSelect'
import SelectCompanyInput from '@/views/scy/components/SelectCompanyInput'
import ErpProjectContractManagerFinalForm from '@/views/erp/report/project/modules/ErpProjectContractManagerFinalForm'
import Ellipsis from '@/components/Ellipsis'
import { getAction } from '@/api/manage'
import ErpProjectReportModal from '@/views/erp/report/project/modules/ErpProjectReportModal'
import { initDictOptions } from '@/components/dict/JDictSelectUtil'
import ErpProjectArchiveForm from '../projectarchive/modules/ErpProjectArchiveForm.vue';
export default {
  name: 'ErpOmcContractManagerFinalList',
  mixins: [JeecgBpmListMixin, mixinDevice, DisabledAuthFilterMixin],
  components: {
    ErpProjectArchiveForm,
    // ErpOmcContractManagerFinalModal,
    ErpProjectContractManagerFinalForm,
    SelectCustomerInput,
    SelectTeamInput,
    SelectProjectInput,
    SelectUserByDep,
    BusinessCategoryNameSelect,
    SelectCompanyInput,
    Ellipsis,
    ErpProjectReportModal
  },
  data() {
    return {

      dateTime:[],
      
      /* 排序参数 */
      isorter: {
        column: 'createTime',
        order: 'desc'
      },
      labelCol: {
        style: {
          width: '100px'
        }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 24 }
      },
      description: '任务档案管理页面',
      // 表头
      columns: [],
      // 列设置
      settingColumns: [],
      // 列定义
      defColumns: [
        {
          title: '序号',
          align: 'center',
          dataIndex: '',
          key: 'rowIndex',
          // fixed: 'left',
          width: 60,
          ellipsis: true,
          customRender: function (t, r, index) {
            return parseInt(index) + 1;
          }
        },
        {
          title: '档案编号',
          align: 'center',
          dataIndex: 'billNo',
          customRender: (text) => {
              if (text === '' || text === null || text === undefined) {
                return '--'
              } else {
                return text
              }
            },
          ellipsis: true,
          width: 180
        },
        {
          title: '项目名称',
          align: 'center',
          dataIndex: 'projectName',
          scopedSlots: { customRender: 'projectName' },
          ellipsis: true,
          width: 200
        },
        {
          title: '项目编号',
          align: 'center',
          dataIndex: 'finalNo',
          ellipsis: true,
          width: 180
        },
        {
          title: '经营团队',
          align: 'center',
          dataIndex: 'signteamName',
          scopedSlots: { customRender: 'signteamName' },
          customRender: (text) => {
            if (text === '' || text === null || text === undefined) {
              return '--'
            } else {
              return text
            }
          },
          width: 180,
          ellipsis: true
        },
        {
          title: '项目承接人',
          align: 'center',
          dataIndex: 'undertakerName',
          customRender: (text) => {
              if (text === '' || text === null || text === undefined) {
                return '--'
              } else {
                return text
              }
            },
          width: 100,
          ellipsis: true
        },
        {
          title: '业主单位',
          align: 'center',
          dataIndex: 'enterpriseName',
          customRender: (text) => {
              if (text === '' || text === null || text === undefined) {
                return '--'
              } else {
                return text
              }
            },
          width: 180,
          ellipsis: true
        },
        {
          title: '收款合同名称',
          align: 'center',
          dataIndex: 'contractName',
          scopedSlots: { customRender: 'htmc' },
          // customRender: (text) => {
          //     if (text === '' || text === null || text === undefined) {
          //       return '--'
          //     } else {
          //       return text
          //     }
          //   },
          width: 200,
          ellipsis: true
        },
        {
          title: '业务分类',
          align: 'center',
          dataIndex: 'categoryName',
          customRender: (text) => {
              if (text === '' || text === null || text === undefined) {
                return '--'
              } else {
                return text
              }
            },
          width: 200,
          ellipsis: true
        },
        {
          title: '合同分配额(元)',
          align: 'center',
          dataIndex: 'contractAmount',
          customRender: (text) => {
              if (text === '' || text === null || text === undefined) {
                return '--'
              } else {
                return text
              }
            },
          width: 110,
          ellipsis: true
        },
        {
          title: '任务类型',
          align: 'center',
          dataIndex: 'taskType_dictText',

          // customRender: (text) => {
          //   if (text === '' || text === null || text === undefined) {
          //     return '--'
          //   } else {
          //     return text
          //   }
          // },
          width: 180,
          ellipsis: true
        },
        {
          title: '生产团队',
          align: 'center',
          dataIndex: 'productTeam_dictText',
          customRender: (text) => {
            if (text === '' || text === null || text === undefined) {
              return '--'
            } else {
              return text
            }
          },
          width: 180,
          ellipsis: true
        },
        {
          title: '实施部门',
          align: 'center',
          dataIndex: 'executeDepart_dictText',
          customRender: (text) => {
            if (text === '' || text === null || text === undefined) {
              return '--'
            } else {
              return text
            }
          },
          width: 180,
          ellipsis: true

        },
        {
          title: '部门负责人',
          align: 'center',
          dataIndex: 'deptLeadName',
          customRender: (text) => {
            if (text === '' || text === null || text === undefined) {
              return '--'
            } else {
              return text
            }
          },
          width: 100,
          ellipsis: true

        },
        {
          title: '项目负责人',
          align: 'center',
          dataIndex: 'projLeadName',
          customRender: (text) => {
            if (text === '' || text === null || text === undefined) {
              return '--'
            } else {
              return text
            }
          },
          width: 100,
          ellipsis: true
        },
        {
          title: '任务进度(%)',
          align: 'center',
          dataIndex: 'taskProgress',
          customRender: (text) => {
              if (text === '' || text === null || text === undefined) {
                return '--'
              } else {
                return text + '%'
              }
            },
          width: 100,
          ellipsis: true
        },
        {
          title: '是否变更中',
          align: 'center',
          dataIndex: 'changeStatus_dictText',
          customRender: (text) => {
              if (text === '' || text === null || text === undefined) {
                return '--'
              } else {
                return text
              }
            },
          width: 100,
          ellipsis: true
        },
        // {
        //   title: '应收款总额(元)',
        //   align: 'center',
        //   dataIndex: 'estimatedContractAmount',
        //   customRender: (text) => {
        //       if (text === '' || text === null || text === undefined) {
        //         return '--'
        //       } else {
        //         return text
        //       }
        //     },
        //   ellipsis: true
        // },
        // {
        //   title: '实收款总额(元)',
        //   align: 'center',
        //   dataIndex: 'amount',
        //   customRender: (text) => {
        //       if (text === '' || text === null || text === undefined) {
        //         return '--'
        //       } else {
        //         return text
        //       }
        //     },
        //   ellipsis: true
        // },
        // {
        //   title: '扣款总额(元)',
        //   align: 'center',
        //   dataIndex: 'amount1',
        //   customRender: (text) => {
        //       if (text === '' || text === null || text === undefined) {
        //         return '--'
        //       } else {
        //         return text
        //       }
        //     },
        //   ellipsis: true
        // },
        {
          title: '状态',
          align: 'center',
          dataIndex: 'distributionType_dictText',
          width: 100,
          ellipsis: true,
          customRender: (text) => {
            if (text === '' || text === null || text === undefined) {
              return '--'
            } else {
              return text
            }
          }
        },
        {
          title: '是否存档',
          align: 'center',
          dataIndex: 'x', // 虚拟列，因为列表页有自定义列,所以每个字段需要一个标识
          ellipsis: true,
          width: 100,
          customRender: (text, record) => {
            if (record.isInFile_dictText === '' || record.isInFile_dictText === null || record.isInFile_dictText === undefined) {
              return '--'
            } else {
              if (record.isInFile == '1') {
                return <a v-on:click={(e) => this.goProjectArchiveDetail(record.id)}>{ record.isInFile_dictText }</a>;
              }
              return record.isInFile_dictText
            }
          }
        },
        {
          title: '存档时间',
          align: 'center',
          dataIndex: 'inFileTime', // 虚拟列，因为列表页有自定义列,所以每个字段需要一个标识
          ellipsis: true,
          width: 100,
          // customRender: (text, record) => {
          //   if (record.isInFile_dictText === '' || record.isInFile_dictText === null || record.isInFile_dictText === undefined) {
          //     return '--'
          //   } else {
          //     if (record.isInFile == '1') {
          //       return <a v-on:click={(e) => this.goProjectArchiveDetail(record.id)}>{ record.isInFile_dictText }</a>;
          //     }
          //     return record.isInFile_dictText
          //   }
          // }
        },
        {
          title: '创建人',
          align: 'center',
          dataIndex: 'createBy_dictText',
          width: 100,
          ellipsis: true,
          customRender: (text) => {
            if (text === '' || text === null || text === undefined) {
              return '--'
            } else {
              return text
            }
          }
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 300,
          scopedSlots: {
            filterDropdown: 'filterDropdown',
            filterIcon: 'filterIcon',
            customRender: 'action'
          }
        }
      ],
      url: {
        list: '/api/erp/omc/project/erpOmcProjectTaskFinal/queryPageList',
        delete: '/api/erp/omc/contractmanager/erpOmcContractManagerFinal/delete',
        deleteBatch: '/api/erp/omc/contractmanager/erpOmcContractManagerFinal/deleteBatch',
        exportXlsUrl: '/api/erp/omc/project/erpOmcProjectTaskFinal/exportXls',
        importExcelUrl: 'api/erp/omc/contractmanager/erpOmcContractManagerFinal/importExcel',
        queryProjectById: '/api/erp/project/report/erpProjectReport/queryById',
        queryProjectArchiveListById: '/api/erp/omc/projectarchive/erpProjectArchive/allList'
      },
      dictOptions: {},
      superFieldList: [],
      qdrqRange: [],
      estimatedContractAmountRange: 0,
      contractAmountRange: 0,
      contractRateRange: 0,
      visibleDetail: false
    }
  },
  created() {
    this.getSuperFieldList();
    // this.initDictConfig()
  },
  computed: {
    importExcelUrl: function () {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
  methods: {
    
    createTimeChange(date, dateString) {
      this.$set(this.queryParam, 'inFileTimeBegin', dateString[0] + ' 00:00:00')
      this.$set(this.queryParam, 'inFileTimeEnd', dateString[1] + ' 23:59:59')
    },

    getContractDetail(val) {
      this.$refs.contractForm.initData(val);
      this.$refs.contractForm.visible = true;
    },
    getDetail(id) {
      this.$router.push({
        path: `/erp/purchase/procurement/ErpPurchaseApplyInvitationListDetail/${id}`
      })
    },
    initDictConfig() {
      initDictOptions('erp_employee_file,name,id').then((res) => {
          if (res.success) {
            this.$set(this.dictOptions, 'projLeadName', res.result)
          }
        })
    },

    handleCancelDetail() {
      this.visibleDetail = false
    },

    // todo: 是否存档穿透到项目存档单里……
    goProjectArchiveDetail(id) {
      this.$nextTick(() => {
        getAction(this.url.queryProjectArchiveListById, { businessName: id, bpmStatus: '3' }).then((res) => {
          if (res.success) {
            if (res.result.records.length === 1) {
              this.visibleDetail = true
              const model = res.result.records[0]
              this.$nextTick(() => {
                this.$refs.realForm.edit(model);
              });
            } else {
              this.$message.warning('无法查看，项目存档存在多条数据！');
            }
          }
        })
      })
    },

    onDetail(id) {
      const that = this
      this.$nextTick(() => {
        getAction(this.url.queryProjectById, { id }).then((res) => {
          if (res.success) {
            const model = res.result
            that.$refs.projectModalForm.getDetail(model);
            that.$refs.projectModalForm.title = '项目一览表';
          }
        })
      })
    },
    getSuperFieldList() {
      let fieldList = [];
      fieldList.push({ type: 'string', value: 'handlerId', text: '经办人编号', dictCode: '' })
      fieldList.push({ type: 'string', value: 'handlerDeptId', text: '经办人部门ID', dictCode: '' })
      fieldList.push({ type: 'string', value: 'handlerDeptCode', text: '经办人部门编码', dictCode: '' })
      fieldList.push({ type: 'string', value: 'delFlag', text: '是否已删除', dictCode: '' })
      fieldList.push({ type: 'string', value: 'htbh', text: '合同编号', dictCode: '' })
      fieldList.push({ type: 'int', value: 'htlx', text: '合同类型', dictCode: '' })
      fieldList.push({ type: 'string', value: 'jytd', text: '经营团队', dictCode: '' })
      fieldList.push({ type: 'string', value: 'htmc', text: '合同名称', dictCode: '' })
      fieldList.push({ type: 'string', value: 'projectName', text: '项目名称', dictCode: '' })
      fieldList.push({ type: 'int', value: 'sfyz', text: '是否用印', dictCode: '' })
      fieldList.push({ type: 'string', value: 'yzdw', text: '业主单位', dictCode: '' })
      fieldList.push({ type: 'string', value: 'qddw', text: '签订单位', dictCode: '' })
      fieldList.push({ type: 'string', value: 'yzlx', text: '印章类型', dictCode: '' })
      fieldList.push({ type: 'int', value: 'yyfs', text: '用印份数', dictCode: '' })
      fieldList.push({ type: 'string', value: 'xmcjr', text: '项目承接人', dictCode: '' })
      fieldList.push({ type: 'int', value: 'glskht', text: '关联收款合同', dictCode: '' })
      fieldList.push({ type: 'date', value: 'qdrq', text: '签订日期' })
      fieldList.push({ type: 'string', value: 'lxr', text: '联系人', dictCode: '' })
      fieldList.push({ type: 'string', value: 'lxfs', text: '联系方式', dictCode: '' })
      fieldList.push({ type: 'int', value: 'yjgsnd', text: '业绩归属年度', dictCode: '' })
      fieldList.push({ type: 'int', value: 'skhte', text: '收款合同额', dictCode: '' })
      fieldList.push({ type: 'date', value: 'fwqx', text: '服务期限' })
      fieldList.push({ type: 'string', value: 'yf', text: '乙方', dictCode: '' })
      fieldList.push({ type: 'string', value: 'bchtedx', text: '本次合同额大写', dictCode: '' })
      fieldList.push({ type: 'string', value: 'skhtedx', text: '收款合同额大写', dictCode: '' })
      fieldList.push({ type: 'string', value: 'skhtmc', text: '收款合同名称', dictCode: '' })
      fieldList.push({ type: 'int', value: 'bchte', text: '本次合同额', dictCode: '' })
      fieldList.push({ type: 'string', value: 'jf', text: '甲方', dictCode: '' })
      fieldList.push({ type: 'string', value: 'xmbh', text: '项目编号', dictCode: '' })
      fieldList.push({ type: 'string', value: 'status', text: '状态', dictCode: '' })
      fieldList.push({ type: 'int', value: 'lx', text: 'lx', dictCode: '' })
      fieldList.push({ type: 'string', value: 'bz', text: 'bz', dictCode: '' })
      fieldList.push({ type: 'string', value: 'yjxx', text: 'yjxx', dictCode: '' })
      fieldList.push({ type: 'string', value: 'xgfj', text: 'xgfj', dictCode: '' })
      this.superFieldList = fieldList
    },
    handleReset() {
      this.qdrqRange = [];
      this.dateTime = []
      this.searchReset();
    },
    businessCategoryHandle(obj) {
      if (obj) {
        this.queryParam.categoryCode = obj.categoryCode;
      }
    },

    // 点击任务委托
    onTaskAllocation (item) {
      this.$router.push({
        path: `/taskdistribution/ErpOmcTaskDistributionList`,
        query: { id: item.id, projectId: item.projectId, type: 'assign' }
      })
    },

    // 任务再委托
    onTaskReAllocation (item) {
      this.$router.push({
        path: `/taskredistribution/TaskRedistributionList`,
        query: { id: item.id, projectId: item.projectId }
      })
    },

    // 点击变更任务委托
    onTaskChange (item) {
      this.$router.push({
        path: `/taskdistribution/ErpOmcTaskDistributionList`,
        query: { id: item.id, projectId: item.projectId, type: 'change' }
      })
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
